gametheory
Class GameTheoryGUI

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by gametheory.GameTheoryGUI
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class GameTheoryGUI
extends javax.swing.JFrame

GUI frontend and control logic for the estimation procedure in Bajari, Hong, and Ryan (2009). The GUI consists of several elements to load in the data, obtain starting values from the private information analogue of the entry game, generate importance games, and run the actual estimation. Use of Netbeans' GUI builder is highly recommended for understand what GUI elements link to which functionality.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 javax.swing.JProgressBar bar
           
 javax.swing.JPanel BarPanel
           
 javax.swing.JButton buttonExecuteMinimization
           
 javax.swing.JButton buttonGenerateImportanceGames
           
 javax.swing.ButtonGroup buttonGroupMinimizerType
           
 javax.swing.ButtonGroup buttonGroupTableView
           
 javax.swing.JButton buttonLoadData
           
 javax.swing.JButton buttonPlotFunction
           
 javax.swing.JButton buttonStartingValues
           
 javax.swing.JCheckBox checkBoxPlot
           
 javax.swing.JTable equilibriaTable
           
 javax.swing.JTextField fieldEfficientShifter
           
 javax.swing.JTextField fieldProfitScaleFactor
           
 javax.swing.JPanel graphPanel
           
 javax.swing.JTextField importanceBidCostField
           
 javax.swing.JLabel jLabel1
           
 javax.swing.JLabel jLabel10
           
 javax.swing.JLabel jLabel11
           
 javax.swing.JLabel jLabel12
           
 javax.swing.JLabel jLabel13
           
 javax.swing.JLabel jLabel14
           
 javax.swing.JLabel jLabel15
           
 javax.swing.JLabel jLabel17
           
 javax.swing.JLabel jLabel2
           
 javax.swing.JLabel jLabel3
           
 javax.swing.JLabel jLabel4
           
 javax.swing.JLabel jLabel5
           
 javax.swing.JLabel jLabel6
           
 javax.swing.JLabel jLabel7
           
 javax.swing.JLabel jLabel8
           
 javax.swing.JLabel jLabel9
           
 javax.swing.JPanel jPanel1
           
 javax.swing.JPanel jPanel2
           
 javax.swing.JRadioButton jRadioButton1
           
 javax.swing.JRadioButton jRadioButton2
           
 javax.swing.JScrollPane jScrollPane1
           
 javax.swing.JScrollPane jScrollPane2
           
 javax.swing.JScrollPane jScrollPane3
           
 javax.swing.JScrollPane jScrollPane4
           
 javax.swing.JSpinner jSpinner1
           
 javax.swing.JTextArea jt
           
 javax.swing.JTable jTable1
           
 javax.swing.JLabel labelStatus
           
 javax.swing.JButton monteCarloButton
           
 javax.swing.JPanel panelControl
           
 javax.swing.JPanel panelEquilibria
           
 javax.swing.JPanel panelEstimates
           
 javax.swing.JPanel panelPayoffs
           
 javax.swing.JRadioButton radioButtonMonteCarloData
           
 javax.swing.JSpinner spinnerMonteCarloNumberIterations
           
 javax.swing.JSpinner spinnerMonteCarloNumObs
           
 javax.swing.JSpinner spinnerNumberImportanceGames
           
 javax.swing.JSpinner spinnerNumberThreads
           
 javax.swing.JSpinner spinnerNumPlayers
           
 javax.swing.JSpinner spinnerOutcomesPerGame
           
 javax.swing.JSpinner spinnerParameterPlot
           
 javax.swing.JTabbedPane tabbedPaneTable
           
 javax.swing.JTable tableResults
           
 javax.swing.JTextField textFieldPureShifter
           
 javax.swing.JPanel TextPanel
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
GameTheoryGUI()
          Creates new form GameTheoryGUI
 
Method Summary
 void append(java.lang.String s)
          Append a string to the primary text area.
 void generateImportanceGames()
          Generate importance games for the estimation.
 void graph()
          Method that graphs the GMM objective function with respect to one parameter.
 void loadData()
          Method to load in the auction entry data.
static void main(java.lang.String[] args)
          Entry point to the empirical application.
 void outputLTEResults(Jama.Matrix results)
          Outputs results from the Chernozhukov and Hong (2003) LTE procedure.
 void outputMatrixResults(Jama.Matrix results)
          Outputs results from the Monte Carlo above.
 void setBarMaximum(int i)
          Set the maximum in the progress bar.
 void setBarValue(int i)
          Sets progress bar value.
 void setButtonsBusy()
          Disables the buttons while some task is processing in the background so that tasks are accomplished sequentially.
 void setButtonsReady()
          Enables all the buttons in the GUI so that an action can be performed.
 void setConstants(double[] guess)
          Utility method to set parameters.
 double[] setGuess()
          Set the initial guess at some parameters defined in GameTheoryConstants.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

BarPanel

public javax.swing.JPanel BarPanel

TextPanel

public javax.swing.JPanel TextPanel

bar

public javax.swing.JProgressBar bar

buttonExecuteMinimization

public javax.swing.JButton buttonExecuteMinimization

buttonGenerateImportanceGames

public javax.swing.JButton buttonGenerateImportanceGames

buttonGroupMinimizerType

public javax.swing.ButtonGroup buttonGroupMinimizerType

buttonGroupTableView

public javax.swing.ButtonGroup buttonGroupTableView

buttonLoadData

public javax.swing.JButton buttonLoadData

buttonPlotFunction

public javax.swing.JButton buttonPlotFunction

buttonStartingValues

public javax.swing.JButton buttonStartingValues

checkBoxPlot

public javax.swing.JCheckBox checkBoxPlot

equilibriaTable

public javax.swing.JTable equilibriaTable

fieldEfficientShifter

public javax.swing.JTextField fieldEfficientShifter

fieldProfitScaleFactor

public javax.swing.JTextField fieldProfitScaleFactor

graphPanel

public javax.swing.JPanel graphPanel

importanceBidCostField

public javax.swing.JTextField importanceBidCostField

jLabel1

public javax.swing.JLabel jLabel1

jLabel10

public javax.swing.JLabel jLabel10

jLabel11

public javax.swing.JLabel jLabel11

jLabel12

public javax.swing.JLabel jLabel12

jLabel13

public javax.swing.JLabel jLabel13

jLabel14

public javax.swing.JLabel jLabel14

jLabel15

public javax.swing.JLabel jLabel15

jLabel17

public javax.swing.JLabel jLabel17

jLabel2

public javax.swing.JLabel jLabel2

jLabel3

public javax.swing.JLabel jLabel3

jLabel4

public javax.swing.JLabel jLabel4

jLabel5

public javax.swing.JLabel jLabel5

jLabel6

public javax.swing.JLabel jLabel6

jLabel7

public javax.swing.JLabel jLabel7

jLabel8

public javax.swing.JLabel jLabel8

jLabel9

public javax.swing.JLabel jLabel9

jPanel1

public javax.swing.JPanel jPanel1

jPanel2

public javax.swing.JPanel jPanel2

jRadioButton1

public javax.swing.JRadioButton jRadioButton1

jRadioButton2

public javax.swing.JRadioButton jRadioButton2

jScrollPane1

public javax.swing.JScrollPane jScrollPane1

jScrollPane2

public javax.swing.JScrollPane jScrollPane2

jScrollPane3

public javax.swing.JScrollPane jScrollPane3

jScrollPane4

public javax.swing.JScrollPane jScrollPane4

jSpinner1

public javax.swing.JSpinner jSpinner1

jTable1

public javax.swing.JTable jTable1

jt

public javax.swing.JTextArea jt

labelStatus

public javax.swing.JLabel labelStatus

monteCarloButton

public javax.swing.JButton monteCarloButton

panelControl

public javax.swing.JPanel panelControl

panelEquilibria

public javax.swing.JPanel panelEquilibria

panelEstimates

public javax.swing.JPanel panelEstimates

panelPayoffs

public javax.swing.JPanel panelPayoffs

radioButtonMonteCarloData

public javax.swing.JRadioButton radioButtonMonteCarloData

spinnerMonteCarloNumObs

public javax.swing.JSpinner spinnerMonteCarloNumObs

spinnerMonteCarloNumberIterations

public javax.swing.JSpinner spinnerMonteCarloNumberIterations

spinnerNumPlayers

public javax.swing.JSpinner spinnerNumPlayers

spinnerNumberImportanceGames

public javax.swing.JSpinner spinnerNumberImportanceGames

spinnerNumberThreads

public javax.swing.JSpinner spinnerNumberThreads

spinnerOutcomesPerGame

public javax.swing.JSpinner spinnerOutcomesPerGame

spinnerParameterPlot

public javax.swing.JSpinner spinnerParameterPlot

tabbedPaneTable

public javax.swing.JTabbedPane tabbedPaneTable

tableResults

public javax.swing.JTable tableResults

textFieldPureShifter

public javax.swing.JTextField textFieldPureShifter
Constructor Detail

GameTheoryGUI

public GameTheoryGUI()
Creates new form GameTheoryGUI

Method Detail

setGuess

public double[] setGuess()
Set the initial guess at some parameters defined in GameTheoryConstants.

Returns:
An array containing the updated guess at the true parameters.

graph

public void graph()
Method that graphs the GMM objective function with respect to one parameter.


setConstants

public void setConstants(double[] guess)
Utility method to set parameters.

Parameters:
guess - Vector of parameters to set.

outputLTEResults

public void outputLTEResults(Jama.Matrix results)
Outputs results from the Chernozhukov and Hong (2003) LTE procedure.

Parameters:
results - Matrix containing the MCMC chain generated by the LTE procedure.

outputMatrixResults

public void outputMatrixResults(Jama.Matrix results)
Outputs results from the Monte Carlo above.

Parameters:
results - Matrix of results from the internal Monte Carlo.

loadData

public void loadData()
Method to load in the auction entry data.


setButtonsReady

public void setButtonsReady()
Enables all the buttons in the GUI so that an action can be performed.


setButtonsBusy

public void setButtonsBusy()
Disables the buttons while some task is processing in the background so that tasks are accomplished sequentially.


generateImportanceGames

public void generateImportanceGames()
Generate importance games for the estimation.


main

public static void main(java.lang.String[] args)
Entry point to the empirical application.

Parameters:
args - the command line arguments

setBarMaximum

public void setBarMaximum(int i)
Set the maximum in the progress bar.

Parameters:
i - Highest value that the bar can take.

setBarValue

public void setBarValue(int i)
Sets progress bar value.

Parameters:
i - Value to set progress bar to.

append

public void append(java.lang.String s)
Append a string to the primary text area.

Parameters:
s - String to be appended.